<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:t="http://www.w3.org/1999/xhtml">
<head th:replace="components/easyui/easyui-list :: head('用户表', 'easyui,upload,ueditor')">
<body>
<form id="form_add">
        <div>
            <input class="easyui-textbox" id="add_username" name="username" data-options="label:'用户名:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-textbox" id="add_password" name="password" data-options="label:'密码:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-textbox" id="add_enabled" name="enabled" data-options="label:'有效:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-textbox" id="add_areaCode" name="areaCode" data-options="label:'手机区号:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-textbox" id="add_phone" name="phone" data-options="label:'手机号:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-textbox" id="add_email" name="email" data-options="label:'邮箱:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-textbox" id="add_address" name="address" data-options="label:'地址:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-numberbox" id="add_age" name="age" data-options="label:'年龄:', width:300, required:true">
        </div>
        <div>
            <input class="easyui-datetimebox" id="add_birth" name="birth" data-options="label:'生日:', width:300, required:true">
        </div>
        <div>
            <label style="width: 80px;float:left;">头像:</label>
            <div th:replace="components/toolbar :: file-upload (idVal='add_headPhoto',nameVal='headPhoto')" style="width:94%;float:left;"></div>
            <div style="clear:both"></div>
        </div>
        <div>
            <input class="easyui-textbox" id="add_personBrief" name="personBrief" data-options="label:'个人简介:', width:300, required:true">
        </div>
        <div>
            <t:dict class="easyui-combobox" id="add_sex" name="sex" dict-name="sex_type" data-options="label:'性别:', width:300, multiple:false"></t:dict>
        </div>
        <div>
            <input class="easyui-textbox" id="add_visitCard" name="visitCard" data-options="label:'邀请码:', width:300, required:true">
        </div>
        <div>
            <t:dict class="easyui-combobox" id="add_loginType" name="loginType" dict-name="login_type" data-options="label:'登录方式:', width:300, multiple:false"></t:dict>
        </div>
        <div>
            <t:dict class="easyui-combobox" id="add_loginStatus" name="loginStatus" dict-name="login_status" data-options="label:'登录状态:', width:300, multiple:false"></t:dict>
        </div>
        <div>
            <input class="easyui-datetimebox" id="add_loginDate" name="loginDate" data-options="label:'登录时间:', width:300, required:true">
        </div>
    <div style="text-align:center;padding:5px 0">
        <a href="javascript:void(0)" class="easyui-linkbutton c-primary" style="width:80px" onclick="add()" th:text="#{ok}"></a>
        <a href="javascript:void(0)" class="easyui-linkbutton c-basic" style="width:80px" onclick="clearForm()" th:text="#{cancel}"></a>
    </div>
</form>
<div id="dlg" class="easyui-dialog" data-options="title:'图片信息',closed:true" style="width:480px;height:480px;padding:10px"></div>
<div id="window_content" class="easyui-window" title="内容详情" data-options="modal:true,closed:true,collapsible:false" style="width:720px;height:480px;padding:10px;"></div>
<div th:replace="components/easyui/easyui-list :: js('easyui,upload,ueditor')"></div>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(function () {
        //实例化编辑器
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
        /*var addEditor = UE.getEditor('add_editor', {
            autoHeight: false
        });*/
        //初始化图片上传按钮
        initFileUpload('#add_headPhoto', 'headPhoto');
    });

    function add() {
        doRequest({
            formId: '#form_add',
            url: '/api/oauthUsers/add',
            type: 'POST',
            extraData: {
            }
        });
    }

    function clearForm() {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }

    /*]]>*/
</script>
</body>
</html>